//
/**
 * Filename: fig10-18_c_signal.c
 * Author:   csbonkers
 * Contact:  forever65535@qq.com
 * Date:     2021/6/19
 * Description:
 *   用sigaction实现signal函数
 */

#include "apue.h"



void sig_alrm(int signo) {
  setbuf(stdout, NULL);
  printf("timer expired.\n");
}
int main(int argc, char *argv[]) {
  c_signal(SIGALRM, sig_alrm);
  while (1) {
    alarm(3);
    pause();
  }
  return 0;
}